
import logging

from openlbsserver.lib.base import *

from openlbsserver.model import meta
from openlbsserver.model import Device

log = logging.getLogger(__name__)

class MainController(BaseController):

    def index(self):
        if 'user_id' in session:
        
            c.devices = meta.Session.query(Device).filter_by(user_id=session['user_id']).all()
        
            return render('index_auth')
        else:
            return render('index')
